package com.zf.zf_demo;

import lombok.Data;

@Data
public class Response <T>{
    private T data;
    public boolean success;
    public String errorMsg;
public static<K> Response <K> newSuccess(K data){
    Response <K> response = new Response<K>();
    response.setData(data);
    response.setSuccess(true);
    return response;
}
  public static Response<Void> newFail(String errorMsg){
    Response <Void> response = new Response<Void>();
        response.setErrorMsg(errorMsg);
        response.setSuccess(false);
        return response;
  }
}
